from aiogram import F
from aiogram_dialog import Dialog, Window
from aiogram_dialog.widgets.kbd import Start

from poker_bot.tg_bot.dialogs.getters.users import user_role_getter
from poker_bot.tg_bot.dialogs.widgets import LocaleText
from poker_bot.tg_bot.states.admin import (
    AccountsForConfirmationSG,
    AdminSG,
    AllDepositsSG,
    AllWithdrawalsSG,
    DepositsForConfirmationSG,
    MailingSG,
    WithdrawalsForConfirmationSG,
)
from poker_bot.tg_bot.states.user import ClientSG

features_window = Window(
    LocaleText("select-option-msg"),
    Start(
        LocaleText("send-mailing-btn"),
        id="mailing",
        state=MailingSG.mailing_text,
        when=F["user_is_admin"],
    ),
    Start(
        LocaleText("unconfirmed-deposits-btn"),
        id="unconfirmed_deposits",
        state=DepositsForConfirmationSG.deposits_list,
        when=F["user_is_admin"],
    ),
    Start(
        LocaleText("all-deposits-btn"),
        id="all_deposits",
        state=AllDepositsSG.deposits_list,
        when=F["user_is_admin"],
    ),
    Start(
        LocaleText("unconfirmed-accounts-btn"),
        id="unconfirmed_accounts",
        state=AccountsForConfirmationSG.accounts_list,
        when=F["user_is_admin"],
    ),
    Start(
        LocaleText("unconfirmed-withdrawals-btn"),
        id="unconfirmed_withdrawals",
        state=WithdrawalsForConfirmationSG.withdrawals_list,
        when=F["user_is_admin"],
    ),
    Start(
        LocaleText("all-withdrawals-btn"),
        id="all_withdrawals",
        state=AllWithdrawalsSG.withdrawals_list,
        when=F["user_is_admin"],
    ),
    Start(
        LocaleText("back-btn"),
        id="back_to_menu",
        state=ClientSG.start,
    ),
    state=AdminSG.admin,
    getter=user_role_getter,
)

admin_dialog = Dialog(features_window)
